namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0150 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.hrm_mp_job_sites", "FK_dbo.hrm_job_site_dbo.hrm_job_site_JobSite_JobSiteId");
            //ALTER TABLE [dbo.Details_tbl] DROP CONSTRAINT [FK_Details_tbl_User_tbl];
            ////Perform more appropriate alters
            //ALTER TABLE [dbo.Details_tbl] ADD FOREIGN KEY (FK_Details_tbl_User_tbl) 
            //    REFERENCES User_tbl(appId);
            ////Perform all appropriate alters to bring the key constraints back

            DropIndex("dbo.hrm_mp_job_sites", new[] { "JobSite_JobSiteId" });
            //Sql("update hrm_mp_job_sites set JobSite_JobSiteId = upper_job_site_seq;");
            DropColumn("dbo.hrm_mp_job_sites", "JobSite_JobSiteId"); 
            //RenameColumn(table: "dbo.hrm_mp_job_sites", name: "JobSite_JobSiteId", newName: "upper_job_site_seq");
        }
        
        public override void Down()
        {
            RenameColumn(table: "dbo.hrm_mp_job_sites", name: "upper_job_site_seq", newName: "JobSite_JobSiteId");
            AddColumn("dbo.hrm_mp_job_sites", "upper_job_site_seq", c => c.Int());
            CreateIndex("dbo.hrm_mp_job_sites", "JobSite_JobSiteId");
        }
    }
}
